package org.yaac.client.conf;

import javax.inject.Inject;
import javax.inject.Provider;

import org.yaac.client.activity.MenuActivity;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;

/**
 * @author Max Zhu (thebbsky@gmail.com)
 *
 */
public class MenuActivityMapper implements ActivityMapper {

	private final Provider<MenuActivity> menuProvider;
	
	/**
	 * @param menuProvider
	 */
	@Inject
	MenuActivityMapper(Provider<MenuActivity> menuProvider) {
		super();
		this.menuProvider = menuProvider;
	}

	@Override
	public Activity getActivity(Place place) {		
		return menuProvider.get().withPlace(place);
	}

}
